<?php

if((strlen($_POST['password1']))>0 && (strlen($_POST['password2']))>0 && strcmp($_POST['password1'],$_POST['password2'])==0)
{
	if(strlen($_POST['zipCode'])==5 && $_POST['zipCode']==strval(intval($_POST['zipCode'])) && $_POST['zipCode']>00000 && $_POST['zipCode']<99999)
	{
	if(strlen($_POST['cellNumber'])==10 && $_POST['cellNumber']==strval(intval($_POST['cellNumber'])))
	{
	if(preg_match("/^[a-zA-Z]{2,3}[0-9]{4}$/",$_POST['CUID']) && (strlen($_POST['CUID'])==6 || strlen($_POST['CUID'])==7))
	{
		if(!(strlen($_POST['firstName'])) && !(strlen($_POST['lastName'])) && !(strlen($_POST['address1'])) && !(strlen($_POST['city'])) && !(strlen($_POST['state'])) && !(strlen($_POST['country'])) && !(strlen($_POST['zipCode'])) && !(strlen($_POST['departmentName'])))
		{
		print('Please fill the name and contact details properly');
		}
		else
		{
		echo 'Hello, ' .$_POST['firstName']. '!';
		}
	}
	else
	{
		print('Enter CUID properly');
		}
		}
		else
		{
		print('Please fill the CellNumber properly');
		}
	}
	else
	{
	print('Enter 5 digit US ZipCode properly. Press back button on browser!');
	}
}
else
{
print('Enter passwords properly. Press BACK button on browser!');
}
?>